#include <stdio.h>

int main()
{
    int n,k,i;
    double sumA=0,sumB=0,nA,nB,a,b;
    scanf("%d %d",&n,&k);

    for(nA=nB=0,i=1;i<=n;i++)
        {
            if(i%k==0)
                {
                    sumA=sumA+i;
                    nA++;
                }
            if(i%k!=0)
                {
                    sumB=sumB+i;
                    nB++;
                }
        }
    a=sumA/nA;
    b=sumB/nB;

    printf("%.1lf %.1lf",a,b);
    return 0;
}